package com.cqvie.model;

import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.hibernate.annotations.GenericGenerator;

@Entity
@Table(name = "LeaveMessage")
public class LeaveMessage {
	private String ID; // 请假条信息的ID
	private Student student;// 学号==请假人
	private String stuClass;// 班级
	private String photo; // 图片
	private String reason; // 请假的原因
	private Date startDate; // 请假开始日期
	private Date endDate; // 结束日期

	@Temporal(TemporalType.DATE)
	public Date getEndDate() {
		return endDate;
	}

	@Id
	@GeneratedValue(generator = "uuid")
	@GenericGenerator(name = "uuid", strategy = "uuid")
	public String getID() {
		return ID;
	}

	public String getPhoto() {
		return photo;
	}

	public String getReason() {
		return reason;
	}

	@Temporal(TemporalType.DATE)
	public Date getStartDate() {
		return startDate;
	}

	public String getStuClass() {
		return stuClass;
	}

	@ManyToOne
	@JoinColumn(name="stuID")
	public Student getStudent() {
		return student;
	}

	public void setEndDate(Date endDate) {
		this.endDate = endDate;
	}

	public void setID(String iD) {
		ID = iD;
	}

	public void setPhoto(String photo) {
		this.photo = photo;
	}

	public void setReason(String reason) {
		this.reason = reason;
	}

	@Temporal(TemporalType.DATE)
	public void setStartDate(Date startDate) {
		this.startDate = startDate;
	}

	public void setStuClass(String stuClass) {
		this.stuClass = stuClass;
	}

	public void setStudent(Student student) {
		this.student = student;
	}
}
